#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
    int y, m, d, a[] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 };
    scanf("%d %d %d", &y, &m, &d);

    for (int i = 1; i <= 10000; i++)
    {
        if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0)
            a[2] = 29;
        else 
            a[2] = 28;

        if (d == a[m])  //如果到该月的最后一天
        {
            d = 1;  //天数重置
            if (m == 12)  //如果到该年的最后一月
            {
                m = 1;  //月份重置
                y++;  //跨年
            }
            else
                m++;
        }
        else
            d++;
    }

    printf("%d-%d-%d", y, m, d);
    return 0;
}